package com.zisu.springcloud.config;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2020/9/1 15:07
 */
@Configuration
public class ApplicationContextConfig {
    @Bean
    //@LoadBalanced   如果用ribbon 做负载均衡 那么需要加这个注解，如果写自定义负载均衡算法 那么不用加这个注解
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
